//
//  PriceConfirmationViewController.swift
//  ParkManage
//
//  Created by cf on 2020/9/22.
//  Copyright © 2020 diligrp. All rights reserved.
//

import UIKit

class PriceConfirmationViewController: BaseViewController {

    @IBOutlet weak var collectionView: UICollectionView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = "价格确认"
        
        let layout = UICollectionViewFlowLayout()
        layout.itemSize = CGSize(width: Configs.Dimensions.screenWidth - 30, height: 115)
        layout.sectionInset = UIEdgeInsets(top: 13, left: 15, bottom: 13, right: 15)
        layout.minimumLineSpacing = 15
        
        collectionView.backgroundColor = .themeBackGround()
        collectionView.collectionViewLayout = layout
        collectionView.register(R.nib.priceConfirmationCell)
    }
}

extension PriceConfirmationViewController: UICollectionViewDataSource {
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        10
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell: PriceConfirmationCell = collectionView.dequeueReusableCell(
            withReuseIdentifier: R.reuseIdentifier.priceConfirmationCell, for: indexPath
        )!
        return cell
    }
}

extension PriceConfirmationViewController: UICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        navigator.push(PriceConfirmationURL.priceDetail.path)
    }
}
